<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>外边距合并-相邻块级元素</title>
    <style>
        .father {
            width: 400px;
            height: 400px;
            background-color: pink;
            margin-top: 50px;
            /* 1.可以为父元素定义上边框 */

            /* border: 1px solid red; */
            /* border: 1px solid transparent; */

            /* 2.可以父元素定义上内边距 */
            /* padding: 1px; */

            /* 3.可以为父元素添加overflow:hidden */
            overflow: hidden;
        }

        .son {
            width: 200px;
            height: 200px;
            background-color: purple;
            margin-top: 100px;
        }
    </style>
</head>

<body>
    <div class="father">
        <div class="son"></div>
    </div>
</body>

</html>